﻿using System;

namespace Server.Core.Serialization.BooMessaging.Contracts
{
    public class BooFieldContract : BooContract
    {
        public BooFieldContract(Type type)
            : base(type)
        {
        }

        public override bool IsPackage
        {
            get { return false; }
        }

        protected override void DoWrite(BooMessageWriter writer, object obj)
        {
            var value = obj == null ? string.Empty : obj.ToString();
            writer.WriteField(value);
        }
    }
}
